<%@page import="org.jasig.cas.client.authentication.AttributePrincipal"%>
<%@page import="org.jasig.cas.client.util.AssertionHolder"%>
<%@page import="java.util.Map"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>this is my test jsp</title>
</head>
<body>
<% if(AssertionHolder.getAssertion()!=null) {%>

   欢迎，<%=AssertionHolder.getAssertion().getPrincipal().getName() %><br/>
 this my test jsp
 
 <%    
       		   out.println("<br>");
               AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();   
              
               String loginName = principal.getName();  
               out.println("loginName:" + loginName);    
               Map<String, Object> attributes = principal.getAttributes();    
               out.println("<br>");    
               if (attributes != null)    
               {    
                   out.println("userId===" + attributes.get("userId"));    
               } 
 %>
 
 <!-- <li><a href="http://app3.micmiu.com:38080/casclient/remoteLogout">登出</a></li> -->
<!-- <li><a href="#" onclick="logOut()">登出</a></li> -->
<!-- <li><input type="button" onclick="logOut()" value="登出"/></li> -->
<li><a href="https://server.cas.com:18443/cas/logout?service=https://server.cas.com:18443/cas/login?TARGET=http://app3.micmiu.com:38080/casclient">登出</a></li>
<!-- <iframe style="display:none;width:0;height:0" id="rlogin" name="rlogin" src="https://demo.micmiu.com:8443/cas/test.jsp?TGC=1234546745234"></iframe> -->
 
 <%} else { %>
 亲，您还未登录哟！
 <%} %>

</body>
</html>